/*
 * Created by SharpDevelop.
 * User: nebulom
 * Date: 9/3/2009
 * Time: 9:46 PM
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;
using System.Drawing;
using System.Windows.Forms;
using PilotFish.Model;

namespace PilotFish.Gui
{
	/// <summary>
	/// Description of DoctorForm.
	/// </summary>
	public partial class DoctorForm : BaseForm
	{
		public DoctorForm() : this(new Doctor())
		{
			
		}
		
		public DoctorForm(Doctor d)
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			Model = d;
		}
		
		void ButtonOkClick(object sender, EventArgs e)
		{
			Doctor d = Model as Doctor;
			d.LegalName = new Name(textBoxTitle.Text, textBoxLastName.Text, textBoxFirstName.Text, textBoxMI.Text);
			SessionFacade.SaveOrUpdateDoctor(d);
			Close();
		}
		
		void ButtonCancelClick(object sender, EventArgs e)
		{
			Close();
		}
	}
}
